package com.ruoyi.asms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.asms.domain.ProxyInfo;
import com.ruoyi.asms.mapper.ProxyInfoMapper;
import com.ruoyi.asms.service.IProxyInfoService;
import com.ruoyi.common.core.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 代理信息Service业务层处理
 * 
 * @author yfkj
 * @date 2021-10-21
 */
@Service
public class ProxyInfoServiceImpl extends ServiceImpl<ProxyInfoMapper, ProxyInfo>  implements IProxyInfoService
{
    @Autowired
    private ProxyInfoMapper proxyInfoMapper;

    /**
     * 查询代理信息
     * 
     * @param proxyInfoId 代理信息主键
     * @return 代理信息
     */
    @Override
    public ProxyInfo selectProxyInfoByProxyInfoId(Long proxyInfoId)
    {
        return proxyInfoMapper.selectProxyInfoByProxyInfoId(proxyInfoId);
    }

    /**
     * 查询代理信息列表
     * 
     * @param proxyInfo 代理信息
     * @return 代理信息
     */
    @Override
    public List<ProxyInfo> selectProxyInfoList(ProxyInfo proxyInfo)
    {
        return proxyInfoMapper.selectProxyInfoList(proxyInfo);
    }

    /**
     * 新增代理信息
     * 
     * @param proxyInfo 代理信息
     * @return 结果
     */
    @Override
    public int insertProxyInfo(ProxyInfo proxyInfo)
    {
        proxyInfo.setCreateTime(System.currentTimeMillis());
        proxyInfo.setCreateBy(SecurityUtils.getUsername());
        return proxyInfoMapper.insertProxyInfo(proxyInfo);
    }

    /**
     * 修改代理信息
     * 
     * @param proxyInfo 代理信息
     * @return 结果
     */
    @Override
    public int updateProxyInfo(ProxyInfo proxyInfo)
    {
        proxyInfo.setUpdateTime(System.currentTimeMillis());
        proxyInfo.setUpdateBy(SecurityUtils.getUsername());

        return proxyInfoMapper.updateProxyInfo(proxyInfo);
    }

    /**
     * 批量删除代理信息
     * 
     * @param proxyInfoIds 需要删除的代理信息主键
     * @return 结果
     */
    @Override
    public int deleteProxyInfoByProxyInfoIds(Long[] proxyInfoIds)
    {
        return proxyInfoMapper.deleteProxyInfoByProxyInfoIds(proxyInfoIds);
    }

    /**
     * 删除代理信息信息
     * 
     * @param proxyInfoId 代理信息主键
     * @return 结果
     */
    @Override
    public int deleteProxyInfoByProxyInfoId(Long proxyInfoId)
    {
        return proxyInfoMapper.deleteProxyInfoByProxyInfoId(proxyInfoId);
    }


}
